#include "SplitToolCppJieba.hh"
#include "SplitTool.hh"
#include "simhash/cppjieba/Jieba.hpp"
#include "SingleJieba.hh"


SplitToolCppJieba::SplitToolCppJieba(){

}
vector<string> SplitToolCppJieba::cut(const string& sentence){
    vector<string> words;
    SingleJieba::createJieba()->getJieba()->Cut(sentence, words);

    // 去停用词 
    vector<string> ret;
    auto& conf_map_zh = Configuration::createConfig()->getStopZh();
    for(auto&elem : words){
        if(conf_map_zh.find(elem) == conf_map_zh.end()){
            ret.push_back(elem);
        }
    }
    return ret;
}
